<!doctype html>



  


<html class="theme-next muse use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.1" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="Linux," />








  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.1" />






<meta name="description" content="&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;vim通过一个叫vimrc的文件来进行设置 &amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;vimrc 配置文件存放位置： &amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;系统vimrc在 /etc/vimr">
<meta name="keywords" content="Linux">
<meta property="og:type" content="article">
<meta property="og:title" content="vim的设置详解">
<meta property="og:url" content="https://hcldirgit.github.io/2017/09/03/1. Linux 基础/31. vim的设置详解/index.html">
<meta property="og:site_name" content="失落的乐章">
<meta property="og:description" content="&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;vim通过一个叫vimrc的文件来进行设置 &amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;vimrc 配置文件存放位置： &amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;系统vimrc在 /etc/vimr">
<meta property="og:locale" content="zh-Hans">
<meta property="og:updated_time" content="2017-09-01T08:28:28.941Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="vim的设置详解">
<meta name="twitter:description" content="&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;vim通过一个叫vimrc的文件来进行设置 &amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;vimrc 配置文件存放位置： &amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;系统vimrc在 /etc/vimr">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Muse',
    sidebar: {"position":"left","display":"post","offset":12,"offset_float":0,"b2t":false,"scrollpercent":false},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://hcldirgit.github.io/2017/09/03/1. Linux 基础/31. vim的设置详解/"/>





  <title>vim的设置详解 | 失落的乐章</title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  




<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
  ga('create', '85*****1', 'auto');
  ga('send', 'pageview');
</script>


  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?87980c**************99ec5e26fb5";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>











  
  
    
  

  <div class="container sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">失落的乐章</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">技术面前，永远都是学生。</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-message">
          <a href="/message" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-external-link"></i> <br />
            
            留言
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
    <link itemprop="mainEntityOfPage" href="https://hcldirgit.github.io/2017/09/03/1. Linux 基础/31. vim的设置详解/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="失落的乐章">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/0.png">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="失落的乐章">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">vim的设置详解</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-09-03T01:55:11+08:00">
                2017-09-03
              </time>
            

            

            
          </span>

          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;vim通过一个叫vimrc的文件来进行设置</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;vimrc 配置文件存放位置：</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;系统vimrc在 /etc/vimrc</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;用户的在 $HOME/.vimrc   这个默认不存在，需用户自定义创建。</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;下面介绍vimrc中常用的配置选项，其中以”为开头的行为不生效的行，也就是说在vimrc配置文件中，它是以”为注释符号的：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div><div class="line">35</div><div class="line">36</div><div class="line">37</div><div class="line">38</div><div class="line">39</div><div class="line">40</div><div class="line">41</div><div class="line">42</div><div class="line">43</div><div class="line">44</div><div class="line">45</div><div class="line">46</div><div class="line">47</div><div class="line">48</div><div class="line">49</div><div class="line">50</div><div class="line">51</div><div class="line">52</div><div class="line">53</div><div class="line">54</div><div class="line">55</div><div class="line">56</div><div class="line">57</div><div class="line">58</div><div class="line">59</div><div class="line">60</div><div class="line">61</div><div class="line">62</div><div class="line">63</div><div class="line">64</div><div class="line">65</div><div class="line">66</div><div class="line">67</div><div class="line">68</div><div class="line">69</div><div class="line">70</div><div class="line">71</div><div class="line">72</div><div class="line">73</div><div class="line">74</div><div class="line">75</div><div class="line">76</div><div class="line">77</div><div class="line">78</div><div class="line">79</div><div class="line">80</div><div class="line">81</div><div class="line">82</div><div class="line">83</div><div class="line">84</div><div class="line">85</div><div class="line">86</div><div class="line">87</div><div class="line">88</div><div class="line">89</div><div class="line">90</div><div class="line">91</div><div class="line">92</div><div class="line">93</div><div class="line">94</div><div class="line">95</div><div class="line">96</div><div class="line">97</div><div class="line">98</div><div class="line">99</div><div class="line">100</div><div class="line">101</div><div class="line">102</div><div class="line">103</div><div class="line">104</div><div class="line">105</div><div class="line">106</div><div class="line">107</div><div class="line">108</div><div class="line">109</div><div class="line">110</div><div class="line">111</div><div class="line">112</div><div class="line">113</div><div class="line">114</div><div class="line">115</div><div class="line">116</div><div class="line">117</div><div class="line">118</div><div class="line">119</div><div class="line">120</div><div class="line">121</div><div class="line">122</div><div class="line">123</div><div class="line">124</div><div class="line">125</div><div class="line">126</div><div class="line">127</div><div class="line">128</div><div class="line">129</div><div class="line">130</div><div class="line">131</div><div class="line">132</div><div class="line">133</div><div class="line">134</div><div class="line">135</div><div class="line">136</div><div class="line">137</div><div class="line">138</div><div class="line">139</div><div class="line">140</div><div class="line">141</div><div class="line">142</div><div class="line">143</div><div class="line">144</div><div class="line">145</div><div class="line">146</div><div class="line">147</div><div class="line">148</div><div class="line">149</div><div class="line">150</div><div class="line">151</div><div class="line">152</div><div class="line">153</div><div class="line">154</div><div class="line">155</div><div class="line">156</div><div class="line">157</div><div class="line">158</div><div class="line">159</div><div class="line">160</div><div class="line">161</div><div class="line">162</div><div class="line">163</div><div class="line">164</div><div class="line">165</div><div class="line">166</div><div class="line">167</div><div class="line">168</div><div class="line">169</div><div class="line">170</div><div class="line">171</div><div class="line">172</div><div class="line">173</div><div class="line">174</div><div class="line">175</div><div class="line">176</div><div class="line">177</div><div class="line">178</div><div class="line">179</div><div class="line">180</div><div class="line">181</div><div class="line">182</div><div class="line">183</div><div class="line">184</div><div class="line">185</div><div class="line">186</div></pre></td><td class="code"><pre><div class="line"><span class="built_in">set</span> nobackup</div><div class="line"></div><div class="line"><span class="string">" 不要生成swap文件，当buffer被丢弃的时候隐藏它</span></div><div class="line"><span class="string">setlocal noswapfile</span></div><div class="line"><span class="string">set bufhidden=hide</span></div><div class="line"><span class="string"></span></div><div class="line"><span class="string">"</span> 字符间插入的像素行数目</div><div class="line"><span class="built_in">set</span> linespace=0</div><div class="line"></div><div class="line"><span class="string">" 增强模式中的命令行自动完成操作</span></div><div class="line"><span class="string">set wildmenu</span></div><div class="line"><span class="string"></span></div><div class="line"><span class="string">"</span> 在状态行上显示光标所在位置的行号和列号</div><div class="line"><span class="built_in">set</span> ruler</div><div class="line"><span class="built_in">set</span> rulerformat=%20(%2*%&lt;%f%=\ %m%r\ %3l\ %c\ %p%%%)</div><div class="line"></div><div class="line"><span class="string">" 命令行（在状态行下）的高度，默认为1，这里是2</span></div><div class="line"><span class="string">set cmdheight=2</span></div><div class="line"><span class="string"></span></div><div class="line"><span class="string">"</span> 使回格键（backspace）正常处理indent, eol, start等</div><div class="line"><span class="built_in">set</span> backspace=2</div><div class="line"></div><div class="line"><span class="string">" 允许backspace和光标键跨越行边界</span></div><div class="line"><span class="string">set whichwrap+=&lt;,&gt;,h,l</span></div><div class="line"><span class="string"></span></div><div class="line"><span class="string">"</span> 可以在buffer的任何地方使用鼠标（类似office中在工作区双击鼠标定位）</div><div class="line"><span class="built_in">set</span> mouse=a</div><div class="line"><span class="built_in">set</span> selection=exclusive</div><div class="line"><span class="built_in">set</span> selectmode=mouse,key</div><div class="line"></div><div class="line"><span class="string">" 启动的时候不显示那个援助索马里儿童的提示</span></div><div class="line"><span class="string">set shortmess=atI</span></div><div class="line"><span class="string"></span></div><div class="line"><span class="string">"</span> 通过使用: commands命令，告诉我们文件的哪一行被改变过</div><div class="line"><span class="built_in">set</span> report=0</div><div class="line"></div><div class="line"><span class="string">" 不让vim发出讨厌的滴滴声</span></div><div class="line"><span class="string">set noerrorbells</span></div><div class="line"><span class="string"></span></div><div class="line"><span class="string">"</span> 在被分割的窗口间显示空白，便于阅读</div><div class="line"><span class="built_in">set</span> fillchars=vert:\ ,stl:\ ,stlnc:\</div><div class="line"></div><div class="line"><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">"</span></div><div class="line"><span class="string">"</span> 搜索和匹配</div><div class="line"><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">"</span></div><div class="line"><span class="string">"</span> 高亮显示匹配的括号</div><div class="line"><span class="built_in">set</span> showmatch</div><div class="line"></div><div class="line"><span class="string">" 匹配括号高亮的时间（单位是十分之一秒）</span></div><div class="line"><span class="string">set matchtime=5</span></div><div class="line"><span class="string"></span></div><div class="line"><span class="string">"</span> 在搜索的时候忽略大小写</div><div class="line"><span class="built_in">set</span> ignorecase</div><div class="line"></div><div class="line"><span class="string">" 不要高亮被搜索的句子（phrases）</span></div><div class="line"><span class="string">set nohlsearch</span></div><div class="line"><span class="string"></span></div><div class="line"><span class="string">"</span> 在搜索时，输入的词句的逐字符高亮（类似firefox的搜索）</div><div class="line"><span class="built_in">set</span> incsearch</div><div class="line"></div><div class="line"><span class="string">" 输入:set list命令是应该显示些啥？</span></div><div class="line"><span class="string">set listchars=tab:\|\ ,trail:.,extends:&gt;,precedes:&lt;,eol:$</span></div><div class="line"><span class="string"></span></div><div class="line"><span class="string">"</span> 光标移动到buffer的顶部和底部时保持3行距离</div><div class="line"><span class="built_in">set</span> scrolloff=3</div><div class="line"></div><div class="line"><span class="string">" 不要闪烁</span></div><div class="line"><span class="string">set novisualbell</span></div><div class="line"><span class="string"></span></div><div class="line"><span class="string">"</span> 我的状态行显示的内容（包括文件类型和解码）</div><div class="line"><span class="built_in">set</span> statusline=%F%m%r%h%w\[POS=%l,%v][%p%%]\%&#123;strftime(\<span class="string">"%d/%m/%y\ -\ %H:%M\")&#125;</span></div><div class="line"><span class="string"></span></div><div class="line"><span class="string">"</span> 总是显示状态行</div><div class="line"><span class="built_in">set</span> laststatus=2</div><div class="line"></div><div class="line"><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">"</span></div><div class="line"><span class="string">"</span> 文本格式和排版</div><div class="line"><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">"</span></div><div class="line"><span class="string">"</span> 自动格式化</div><div class="line"><span class="built_in">set</span> formatoptions=tcrqn</div><div class="line"></div><div class="line"><span class="string">" 继承前一行的缩进方式，特别适用于多行注释</span></div><div class="line"><span class="string">set autoindent</span></div><div class="line"><span class="string"></span></div><div class="line"><span class="string">"</span> 为C程序提供自动缩进</div><div class="line"><span class="built_in">set</span> smartindent</div><div class="line"></div><div class="line"><span class="string">" 使用C样式的缩进</span></div><div class="line"><span class="string">set cindent</span></div><div class="line"><span class="string"></span></div><div class="line"><span class="string">"</span> 制表符为4</div><div class="line"><span class="built_in">set</span> tabstop=4</div><div class="line"></div><div class="line"><span class="string">" 统一缩进为4</span></div><div class="line"><span class="string">set softtabstop=4</span></div><div class="line"><span class="string">set shiftwidth=4</span></div><div class="line"><span class="string"></span></div><div class="line"><span class="string">"</span> 不要用空格代替制表符</div><div class="line"><span class="built_in">set</span> noexpandtab</div><div class="line"></div><div class="line"><span class="string">" 不要换行</span></div><div class="line"><span class="string">set nowrap</span></div><div class="line"><span class="string"></span></div><div class="line"><span class="string">"</span> 在行和段开始处使用制表符</div><div class="line"><span class="built_in">set</span> smarttab</div><div class="line"></div><div class="line"><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">"</span></div><div class="line"><span class="string">"</span> CTags的设定</div><div class="line"><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">"</span></div><div class="line"><span class="string">"</span> 按照名称排序</div><div class="line"><span class="built_in">let</span> Tlist_Sort_Type = <span class="string">"name"</span></div><div class="line"></div><div class="line"><span class="string">" 在右侧显示窗口</span></div><div class="line"><span class="string">let Tlist_Use_Right_Window = 1</span></div><div class="line"><span class="string"></span></div><div class="line"><span class="string">"</span> 压缩方式</div><div class="line"><span class="built_in">let</span> Tlist_Compart_Format = 1</div><div class="line"></div><div class="line"><span class="string">" 如果只有一个buffer，kill窗口也kill掉buffer</span></div><div class="line"><span class="string">let Tlist_Exist_OnlyWindow = 1</span></div><div class="line"><span class="string"></span></div><div class="line"><span class="string">"</span> 不要关闭其他文件的tags</div><div class="line"><span class="built_in">let</span> Tlist_File_Fold_Auto_Close = 0</div><div class="line"></div><div class="line"><span class="string">" 不要显示折叠树</span></div><div class="line"><span class="string">let Tlist_Enable_Fold_Column = 0</span></div><div class="line"><span class="string"></span></div><div class="line"><span class="string">"</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span></div><div class="line"><span class="string">" Autocommands</span></div><div class="line"><span class="string">"</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span><span class="string">""</span></div><div class="line"><span class="string">" 只在下列文件类型被侦测到的时候显示行号，普通文本文件不显示</span></div><div class="line"><span class="string"></span></div><div class="line"><span class="string">if has("</span>autocmd<span class="string">")</span></div><div class="line"><span class="string">autocmd FileType xml,html,c,cs,java,perl,shell,bash,cpp,python,vim,php,ruby set number</span></div><div class="line"><span class="string">autocmd FileType xml,html vmap 'o'&gt;o--&gt;</span></div><div class="line"><span class="string">autocmd FileType java,c,cpp,cs vmap ' 0 &amp;&amp; line("</span><span class="string">'\"") &lt;= line("$") |</span></div><div class="line"><span class="string">\ exe " normal g`\"" |</span></div><div class="line"><span class="string">\ endif</span></div><div class="line"><span class="string">endif "has("autocmd")</span></div><div class="line"><span class="string"></span></div><div class="line"><span class="string">" F5编译和运行C程序，F6编译和运行C++程序</span></div><div class="line"><span class="string">" 请注意，下述代码在windows下使用会报错</span></div><div class="line"><span class="string">" 需要去掉./这两个字符</span></div><div class="line"><span class="string"></span></div><div class="line"><span class="string">" C的编译和运行</span></div><div class="line"><span class="string">map  :call CompileRunGcc()</span></div><div class="line"><span class="string">func! CompileRunGcc()</span></div><div class="line"><span class="string">exec "w"</span></div><div class="line"><span class="string">exec "!gcc % -o %&lt;"</span></div><div class="line"><span class="string">exec "! ./%&lt;"</span></div><div class="line"><span class="string">endfunc</span></div><div class="line"><span class="string"></span></div><div class="line"><span class="string">" C++的编译和运行</span></div><div class="line"><span class="string">map  :call CompileRunGpp()</span></div><div class="line"><span class="string">func! CompileRunGpp()</span></div><div class="line"><span class="string">exec "w"</span></div><div class="line"><span class="string">exec "!g++ % -o %&lt;"</span></div><div class="line"><span class="string">exec "! ./%&lt;"</span></div><div class="line"><span class="string">endfunc</span></div><div class="line"><span class="string"></span></div><div class="line"><span class="string">" 能够漂亮地显示.NFO文件</span></div><div class="line"><span class="string">set encoding=utf-8</span></div><div class="line"><span class="string">function! SetFileEncodings(encodings)</span></div><div class="line"><span class="string">let b:myfileencodingsbak=&amp;fileencodings</span></div><div class="line"><span class="string">let &amp;fileencodings=a:encodings</span></div><div class="line"><span class="string">endfunction</span></div><div class="line"><span class="string">function! RestoreFileEncodings()</span></div><div class="line"><span class="string">let &amp;fileencodings=b:myfileencodingsbak</span></div><div class="line"><span class="string">unlet b:myfileencodingsbak</span></div><div class="line"><span class="string">endfunction</span></div><div class="line"><span class="string"></span></div><div class="line"><span class="string">au BufReadPre *.nfo call SetFileEncodings('</span>cp437<span class="string">')|set ambiwidth=single au BufReadPost *.nfo call RestoreFileEncodings()</span></div><div class="line"><span class="string"></span></div><div class="line"><span class="string">" 高亮显示普通txt文件（需要txt.vim脚本）</span></div><div class="line"><span class="string">au BufRead,BufNewFile * setfiletype txt</span></div><div class="line"><span class="string"></span></div><div class="line"><span class="string">" 用空格键来开关折叠</span></div><div class="line"><span class="string">set foldenable</span></div><div class="line"><span class="string">set foldmethod=manual</span></div><div class="line"><span class="string">nnoremap  @=((foldclosed(line('</span>.<span class="string">')) &lt; 0) ? '</span>zc<span class="string">':'</span>zo<span class="string">')</span></div><div class="line"><span class="string"></span></div><div class="line"><span class="string">" minibufexpl插件的一般设置</span></div><div class="line"><span class="string">let g:miniBufExplMapWindowNavVim = 1</span></div><div class="line"><span class="string">let g:miniBufExplMapWindowNavArrows = 1</span></div><div class="line"><span class="string">let g:miniBufExplMapCTabSwitchBufs = 1</span></div><div class="line"><span class="string">let g:miniBufExplModSelTarget = 1</span></div></pre></td></tr></table></figure>
      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/Linux/" rel="tag"># Linux</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2017/09/03/1. Linux 基础/22. parted 分区 GPT格式/" rel="next" title="parted 分区 GPT 格式">
                <i class="fa fa-chevron-left"></i> parted 分区 GPT 格式
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2017/09/03/1. Linux 基础/48.Linux下比较两个时间的时间差/" rel="prev" title="Linux下比较两个时间的时间差">
                Linux下比较两个时间的时间差 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      

      <section class="site-overview sidebar-panel sidebar-panel-active">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/images/0.png"
               alt="失落的乐章" />
          <p class="site-author-name" itemprop="name">失落的乐章</p>
           
              <p class="site-description motion-element" itemprop="description">失落的乐章的Blog</p>
          
        </div>
        <nav class="site-state motion-element">

          
            <div class="site-state-item site-state-posts">
              <a href="/">
                <span class="site-state-item-count">627</span>
                <span class="site-state-item-name">日志</span>
              </a>
            </div>
          

          

          
            
            
            <div class="site-state-item site-state-tags">
              <a href="/tags/index.html">
                <span class="site-state-item-count">38</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/hcldirgit" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                  GitHub
                </a>
              </span>
            
          
        </div>

        
        

        
        

        


      </section>

      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2017</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">失落的乐章</span>
</div>


<div class="powered-by">
  由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
  主题 -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Muse
  </a>
</div>


        

        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.1"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.1"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.1"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.1"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.1"></script>



  


  




	





  





  





  






  





  

  

  

  

  

  

</body>
</html>
